package academic.concordia.bankofquebec.managedbean;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;

import org.springframework.beans.factory.annotation.Autowired;

import academic.concordia.bankofquebec.bean.mutualfunds.IMutualFundsBean;
import academic.concordia.bankofquebec.entity.Transaction;

@ManagedBean
@SessionScoped
public class MutualFundsManagedBean {
	
	@ManagedProperty(value = "#{productManagedBean}")
	private ProductManagedBean productManagedBean;
	
	@Autowired
	private IMutualFundsBean mutualFundsBean;

	public ProductManagedBean getProductManagedBean() {
		return productManagedBean;
	}

	public void setProductManagedBean(ProductManagedBean productManagedBean) {
		this.productManagedBean = productManagedBean;
	}
	
	public List<Transaction> listLastMovements() {
		return productManagedBean.getSelectedProduct().getTransactions();
	}
}
